Caches dissipate significant amounts of power, including leakage power. This power may be reduced by power gating the cache when all cores sharing the cache are in an idle (cc6) state. For the cache to be powered down, all of the modified states in the cache (dirty data) must be flushed. Flushing state requires significant time and power, particularly if there is a lot of state to be flushed.
Present solutions contemplate proactively flushing the cache. However, present solutions do not differentiate based on modified or non-modified data. This may be achieved by examining the location in the least recently used (LRU) chain to determine stale data. Any modified block in the LRU chain is proactively written back. This solution diminishes the number of stale writes residing in the cache, but does not address the non-stale writes. Further, this solution does not address the issue of whether data should be written back at all or retained in the cache regardless of where it resides in the LRU chain.
Other solutions may keep a bit per subset of cache lines indicating whether there is any dirty data in the blocks. In this way, a set of lines may be eliminated if none of the lines retain any dirty data without having to walk through each cache line. This may eliminate spurious checks for dirty data that are not required, but fails to address the problem of eliminating dirty data from the cache.
There is a need to therefore address the problem of minimizing the amount of dirty data in the shared cache when there is a higher likelihood that the shared cache will be shut down.